package sg.edu.nus.iss.vmcs.store;

import java.util.ArrayList;

import sg.edu.nus.iss.vmcs.price.PriceCalculator;

/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

/**
 *
 *
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */
/**
 * @author Zaw (modified)
 * CashStoreItemIterator
 */
public class DrinksStore extends Store {

	public DrinksStore() {
	}
	
	public DrinksStore(int itemn) {
		super(itemn);
	}

	@Override
	public StoreItemIterator createDrinStoreItemIterator(){
		ArrayList<DrinksStoreItem> ls = new ArrayList<DrinksStoreItem>();
		for (int i = 0; i < size; i++) {
			ls.add((DrinksStoreItem) getStoreItem(i));
		}
		return new DrinkStoreItemIterator(ls);
	}
	
	/**
	 * Add common Calculator for all Drinks
	 */
	public void addCalc(int context){
		for (int i = 0; i < size; i++) {
			DrinksBrand item = (DrinksBrand) getStoreItem(i).getContent();
			item.getPricing().addCalc(context);
		}
	}

}
